Xbasic

OBJECT.ACTIVE_PREV Function

Syntax

.Active_Prev([L fullname])

Arguments

fullname

Optional. Default = .F. (FALSE)

.F. = Returns control name.
.T. = Returns fully qualified control name.

Description

Returns the name of the control that previously had focus.

Discussion

The <OBJECT>.ACTIVE_PREV() method applies to:

Browses (for <OBJECT> use either the <BROWSE> pointer or the name of the browse)
Forms (for <OBJECT> use either the <FORM> pointer or the name of the form)

The <OBJECT>.ACTIVE_PREV() method returns the name of the control which previously had focus.

Example

This script returns the name of the control on the Sales form that previously had focus.

name = :Sales.Active_prev()

This script (which is attached to a button on a form) returns focus to the object that had focus immediately prior to clicking the button (so that the button code can operate on that object). In this example, the button blanks out the value in the field that had focus by setting its text property to a NULL value.

prev_obj = parentform.Active_prev()
obj_point = obj(prev_obj)
obj_point.activate()
obj_point.text = ""

Limitations

Desktop applications only.

See Also